﻿using System;
using System.Collections.Generic;

namespace Mono.Cecil.PE
{
	// Token: 0x020000EE RID: 238
	internal sealed class ByteBufferEqualityComparer : IEqualityComparer<ByteBuffer>
	{
		// Token: 0x060009A3 RID: 2467 RVA: 0x0002AD50 File Offset: 0x00028F50
		public bool Equals(ByteBuffer x, ByteBuffer y)
		{
			bool flag = x.length != y.length;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				byte[] buffer = x.buffer;
				byte[] buffer2 = y.buffer;
				for (int i = 0; i < x.length; i++)
				{
					bool flag2 = buffer[i] != buffer2[i];
					if (flag2)
					{
						return false;
					}
				}
				result = true;
			}
			return result;
		}

		// Token: 0x060009A4 RID: 2468 RVA: 0x0002ADBC File Offset: 0x00028FBC
		public int GetHashCode(ByteBuffer buffer)
		{
			int num = -2128831035;
			byte[] buffer2 = buffer.buffer;
			for (int i = 0; i < buffer.length; i++)
			{
				num = (num ^ (int)buffer2[i]) * 16777619;
			}
			return num;
		}
	}
}
